package com.baor.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class AddDaysUtil {
    private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

    public static String addDays(String dateString, int daysToAdd) {
        try {
            Date date = sdf.parse(dateString);
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(date);
            calendar.add(Calendar.DAY_OF_MONTH, daysToAdd);

            Date newDate = calendar.getTime();
            return sdf.format(newDate);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

}

